package tiandang.core.dao;

import org.apache.ibatis.annotations.Param;
import tiandang.core.model.Promo;

import java.math.BigDecimal;
import java.util.List;

public interface PromoMapper {
  int deleteByPrimaryKey(Integer id);

  int insertSelective(Promo record);

  Promo selectByPrimaryKey(Integer id);

  int updateByPrimaryKeySelective(Promo record);

  void setIsShow(@Param("id") Integer id, @Param("isShow") Integer isShow);

  List<Promo> getListByParams(@Param("startTimestamp") Long startTimestamp,
                              @Param("endTimestamp") Long endTimestamp,
                              @Param("limit") Integer limit,
                              @Param("offset") Integer offset);

  int countByParams(@Param("startTimestamp") Long startTimestamp, @Param("endTimestamp") Long endTimestamp);

  void overNow(@Param("id") Integer id, @Param("now") Long now);

  List<Promo> getListByStartTimeAndEndTime(@Param("startTimestamp") Long startTimestamp,
                                           @Param("endTimestamp") Long endTimestamp);

  void addIncomeAmount(@Param("id") Integer id, @Param("income") BigDecimal income);

  void minusIncomeAmount(@Param("id") Integer id, @Param("income") BigDecimal income);

  List<Promo> getListByIdList(@Param("idList") List<Integer> idList);

  List<Promo> getAll();

  List<Promo> getListByManagerId(@Param("managerId") Integer managerId);

  void updatePushStatus(@Param("id") Integer id);
}